<template>
  <div>
    <h1>swiper组件</h1>
    <div class="container">
      <div class="swiper-container">
        <div class="swiper-wrapper">
          <div class="swiper-slide">
              <img src="../../assets/banners/01.jpg" alt="">
          </div>
          <div class="swiper-slide">
              <img src="../../assets/banners/02.jpg" alt="">
          </div>
          <div class="swiper-slide">
              <img src="../../assets/banners/03.jpg" alt="">
          </div>
          <div class="swiper-slide">
              <img src="../../assets/banners/04.jpg" alt="">
          </div>
        </div>
        <!-- Add Pagination -->
        <div class="swiper-pagination"></div>
        <!-- Add Arrows -->
        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
      </div>
    </div>
  </div>
</template>

<script>
// 导入依赖
import Swiper from "swiper";
// 导入css样式表
import "swiper/dist/css/swiper.min.css";
export default {
  data() {
    return {};
  },
  created() {
    console.log(this.$aaa)
  },
  mounted() {
    new Swiper(".swiper-container", {
      pagination: ".swiper-pagination",
      nextButton: ".swiper-button-next",
      prevButton: ".swiper-button-prev",
      paginationClickable: true,
      spaceBetween: 30,
      centeredSlides: true,
      autoplay: 2500,
      autoplayDisableOnInteraction: false,
    });
  },
  methods: {},
  components: {},
};
</script>
<style scoped>
.container {
  width: 800px;
}
.swiper-container {
  width: 100%;
  height: 100%;
}
.swiper-slide {
  text-align: center;
  font-size: 18px;
  background: #fff;

  /* Center slide text vertically */
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
}
</style>